package com.bwie.spike.conf;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.bwie.common.utils.R;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @ClassName Exceptionconfig
 * @Description TODO
 * @Author 李奉武
 * @Motto 逆水行舟, 不进则退
 * @Date 2022/2/23 15:43
 * @Version 1.0
 */
public final class ExceptionConfig {
    public static R  handleException(@RequestParam Map<String, Object> params,BlockException ex) {
        System.err.println("错误发生: " + ex.getClass().getCanonicalName());
        return R.error("发生降级了");
    }
}
